package com.reliable.service.controller;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.reliable.api.param.dataType.ReliableDataTypePageParam;
import com.reliable.common.core.domain.AjaxResult;
import com.reliable.common.core.page.TableDataInfo;
import com.reliable.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.reliable.service.domain.ReliableDataType;
import com.reliable.service.service.IReliableDataTypeService;

/**
 * 导出数据类型字典表Controller
 * 
 * @author ruoyi
 * @date 2025-10-29
 */
@RestController
@RequestMapping("/reliable/datatype")
@Api(value = "导出数据类型字典表控制器", tags = {"导出数据类型字典表管理"})
public class ReliableDataTypeController {

    @Autowired
    private IReliableDataTypeService reliableDataTypeService;

    /**
     * 查询导出数据类型字典表列表
     */
    @ApiOperation("查询导出数据类型字典表列表")
    @PostMapping("/list")
    public AjaxResult list() {
        LambdaQueryWrapper<ReliableDataType> wrapper = new LambdaQueryWrapper<>();
        wrapper.orderByAsc(ReliableDataType::getSortOrder);
        List<ReliableDataType> data = reliableDataTypeService.list(wrapper);
        return AjaxResult.success(data);
    }


    /**
     * 响应返回结果
     *
     * @param rows 影响行数
     * @return 操作结果
     */
    protected AjaxResult toAjax(boolean rows) {
        return rows ? AjaxResult.success() : AjaxResult.error();
    }
}